home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / g / gnu_c / gempp19.zoo / gem++19 / src / vdi.cc < prev   
Encoding:
C/C++ Source or Header  |  1993-11-10  |  19.4 KB  |  534 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  This file is Copyright 1992,1993 by Warwick W. Allison.
  4. //  This file is part of the gem++ library.
  5. //  You are free to copy and modify these sources, provided you acknowledge
  6. //  the origin by retaining this notice, and adhere to the conditions
  7. //  described in the file COPYING.LIB.
  8. //
  9. /////////////////////////////////////////////////////////////////////////////
  10.  
  11. #include "vdi.h"
  12. #include <vdibind.h>
  13. #include <aesbind.h>
  14. #include <osbind.h>
  15. #include <values.h>
  16.  
  17. #include <stdio.h>
  18.  
  19.  
  20. static const int NWI=11;
  21. static const int NWO=57;
  22.  
  23. // Flags.
  24. //
  25. //  Top 1 bit signals that fonts are loaded.
  26. //  Next 7 bits are total # fonts.
  27. //  Low 8 bits are for device type.
  28. //
  29. #define SCREENVDI (Getrez()+2)
  30. static const int METAVDI=31;
  31. static const int FONTS_LOADED=0x8000;
  32.  
  33. // SpeedoGDOS does not return correct value for WorkOut(10).
  34. static const int NUM_FONTS=0x7f00;
  35. static const int NUM_FONTS_SHIFT=8;
  36.  
  37. static const int DEVICE_TYPE=0x00ff;
  38.  
  39. static int STDWORKIN[]={9999,1,1,1,1,1,1,1,1,1,2};
  40.  
  41. // NWO * sizeof(int) bytes for each cache cell.
  42. // But only when actually used.
  43. //
  44. static const NUM_WORKOUT_CACHE=16;
  45.  
  46. class WorkOut_CacheCell {
  47. public:
  48.     WorkOut_CacheCell() :
  49.         owner(0),
  50.         workout(0),
  51.         extend(FALSE)
  52.     {
  53.     }
  54.  
  55.     const VDI* owner;
  56.     int* workout;
  57.     bool extend;
  58. };
  59.  
  60. static WorkOut_CacheCell WORKOUT_CACHE[NUM_WORKOUT_CACHE];
  61.  
  62. int* WORKOUTfor(const VDI* vdi, bool ext, bool fill_if_new_array)
  63. {
  64.     // Check most-recently-used cache first.
  65.  
  66.     static int index=0;
  67.  
  68.     for (int i=0; i<NUM_WORKOUT_CACHE; i++) {
  69.         if (WORKOUT_CACHE[index].owner==vdi && WORKOUT_CACHE[index].extend==ext) {
  70.             return WORKOUT_CACHE[index].workout;
  71.         }
  72.         index=(index+1)%NUM_WORKOUT_CACHE;
  73.     }
  74.  
  75.     // Not found.  Reuse old cell belonging to a DIFFERENT VDI.
  76.  
  77.     // Terminates since at most 1 has this owner, since we
  78.     // can never get two caches with same (owner,extend).
  79.     //
  80.     while (WORKOUT_CACHE[index].owner==vdi) {
  81.         index=(index+1)%NUM_WORKOUT_CACHE;
  82.     }
  83.  
  84.     WORKOUT_CACHE[index].owner=vdi;
  85.     if (!WORKOUT_CACHE[index].workout)
  86.         WORKOUT_CACHE[index].workout=new int[NWO];
  87.  
  88.     if (fill_if_new_array)
  89.         vdi->q_extnd(ext,WORKOUT_CACHE[index].workout);
  90.  
  91.     WORKOUT_CACHE[index].extend=ext;
  92.  
  93.     return WORKOUT_CACHE[index].workout;
  94. }
  95.  
  96. void DeleteWORKOUTfor(const VDI* vdi)
  97. {
  98.     for (int i=0; i<NUM_WORKOUT_CACHE; i++) {
  99.         if (WORKOUT_CACHE[i].owner==vdi) {
  100.             delete WORKOUT_CACHE[i].workout;
  101.             WORKOUT_CACHE[i].workout=0;
  102.             WORKOUT_CACHE[i].owner=0;
  103.         }
  104.     }
  105. }
  106.  
  107.  
  108. enum GDOStype { GDOS_UNKNOWN=-1, NoGDOS=0, OutlineGDOS, FontGDOS, EarlyGDOS };
  109.  
  110. static GDOStype GDOS_available()
  111. {
  112.     static GDOStype gdos_active=GDOS_UNKNOWN;
  113.  
  114.     if (gdos_active==GDOS_UNKNOWN) {
  115.         switch (vq_vgdos()) {
  116.          case GDOS_NONE:
  117.             gdos_active = NoGDOS; // Or other dyslexic pets? :)
  118.         break; case GDOS_FSM:
  119.             gdos_active = OutlineGDOS;
  120.         break; case GDOS_FNT:
  121.             gdos_active = FontGDOS;
  122.         break; default:
  123.             gdos_active = EarlyGDOS;
  124.         }
  125.     }
  126.  
  127.     return gdos_active;
  128. }
  129.  
  130. static MFDB AESMFDB;
  131.  
  132.  
  133.  
  134. VDI::VDI()
  135. {
  136.     flags=SCREENVDI;
  137.  
  138.     int j;
  139.     handle=graf_handle(&j,&j,&j,&j);
  140.  
  141.     STDWORKIN[0]=flags&DEVICE_TYPE;
  142.  
  143.     int ihandle=handle;
  144.     v_opnvwk(STDWORKIN,&ihandle,WORKOUTfor(this,FALSE,FALSE));
  145.     handle=ihandle;
  146.     AESMFDB.fd_addr=0;
  147. }
  148.  
  149. VDI::VDI(const char* metafile) :
  150.     flags(METAVDI)
  151. {
  152.     if (vq_vgdos()==GDOS_NONE) {
  153.         handle=0;
  154.     } else {
  155.         int ihandle;
  156.         int WORKIN[NWI]=STDWORKIN;
  157.  
  158.         WORKIN[0]=flags;
  159.         //WORKIN[10]=0;
  160.  
  161.         v_opnwk(WORKIN,&ihandle,WORKOUTfor(this,FALSE,FALSE));
  162.         handle=ihandle;
  163.  
  164.         if (strcmp(metafile,"GEMFILE.GEM")!=0) {
  165.             m_filename(metafile);
  166.             Fdelete("GEMFILE.GEM");
  167.         }
  168.     }
  169. }
  170.  
  171. VDI::~VDI()
  172. {
  173.     st_unload_fonts();
  174.  
  175.     if (flags<=10) {
  176.         v_clsvwk(handle);
  177.     } else {
  178.         v_clswk(handle);
  179.     }
  180.  
  181.     DeleteWORKOUTfor(this);
  182. }
  183.  
  184. void VDI::clrwk() { v_clrwk(handle); }
  185. void VDI::updwk() { v_updwk(handle); }
  186. int VDI::swr_mode (int mode) { return vswr_mode (handle, mode); }
  187. void VDI::s_color (int index, int rgb[]) { vs_color (handle, index, rgb); }
  188. int VDI::sl_type (int style) { return vsl_type (handle, style); }
  189. void VDI::sl_udsty (int pat) { vsl_udsty (handle, pat); }
  190. int VDI::sl_width (int width) { return vsl_width (handle, width); }
  191. int VDI::sl_color (int index) { return vsl_color (handle, index); }
  192. void VDI::sl_ends (int begstyle, int endstyle) { vsl_ends (handle, begstyle, endstyle); }
  193. int VDI::sm_type (int symbol) { return vsm_type (handle, symbol); }
  194. void VDI::sm_height (int height) { vsm_height (handle, height); }
  195. int VDI::sm_color (int index) { return vsm_color (handle, index); }
  196. int VDI::st_height (int height, int *charw, int *charh, int *cellw, int *cellh) { return vst_height (handle, height, charw, charh, cellw, cellh); }
  197. int VDI::st_point (int point, int *charw, int *charh, int *cellw, int *cellh) { return vst_point (handle, point, charw, charh, cellw, cellh); }
  198. int VDI::st_rotation (int ang) { return vst_rotation (handle, ang); }
  199. int VDI::st_font (int font) { return vst_font (handle, font); }
  200. int VDI::st_color (int index) { return vst_color (handle, index); }
  201. int VDI::st_effects (int effects) { return vst_effects (handle, effects); }
  202. void VDI::st_alignment (int hin, int vin, int *hout, int *vout) { vst_alignment (handle, hin, vin, hout, vout); } 
  203. int VDI::sf_interior (int style) { return vsf_interior (handle, style); }
  204. int VDI::sf_fill (int style) { return vsf_fill (handle, style); }
  205. int VDI::sf_style (int style) { return vsf_style (handle, style); }
  206. int VDI::sf_color (int index) { return vsf_color (handle, index); }
  207. int VDI::sf_perimeter (int vis) { return vsf_perimeter (handle, vis); }
  208. void VDI::sf_udpat (int pat[], int planes) { vsf_udpat (handle, pat, planes); }
  209.  
  210. int VDI::st_load_fonts (int select)
  211. {
  212.     if (GDOS_available()) {
  213.         if ((flags&FONTS_LOADED) == 0) {
  214.             flags^=FONTS_LOADED;
  215.             int numfonts = WorkOut(15);
  216.             int extrafonts = vst_load_fonts (handle, select);
  217.             numfonts+=extrafonts;
  218.             if (numfonts>(NUM_FONTS>>NUM_FONTS_SHIFT)) {
  219.                 flags|=NUM_FONTS;
  220.             } else {
  221.                 flags|=(numfonts<<NUM_FONTS_SHIFT);
  222.             }
  223.             return extrafonts;
  224.         }
  225.     }
  226.  
  227.     return 0;
  228. }
  229.  
  230. void VDI::st_unload_fonts (int select)
  231. {
  232.     if ((flags&FONTS_LOADED) != 0) {
  233.         flags^=FONTS_LOADED;
  234.         flags&=~NUM_FONTS;
  235.         vst_unload_fonts (handle, select);
  236.     }
  237. }
  238.  
  239. int VDI::NumberOfTextFaces() const
  240. {
  241.     if ((flags&FONTS_LOADED) == 0) {
  242.         return WorkOut(15);
  243.     } else {
  244.         return (flags&NUM_FONTS)>>NUM_FONTS_SHIFT;
  245.     }
  246. }
  247.  
  248. void VDI::s_clip (int clip_flag, int pxyarray[]) { vs_clip (handle, clip_flag, pxyarray); }
  249.  
  250. void VDI::bar (int pxyarray[]) { v_bar (handle, pxyarray); }
  251. void VDI::arc (int x, int y, int radius, int begang, int endang) { v_arc (handle, x, y, radius, begang, endang); } 
  252. void VDI::pieslice (int x, int y, int radius, int begang, int endang) { v_pieslice (handle, x, y, radius, begang, endang); }
  253. void VDI::circle (int x, int y, int radius) { v_circle (handle, x, y, radius); }
  254. void VDI::ellarc (int x, int y, int xrad, int yrad, int begang, int endang) { v_ellarc (handle, x, y, xrad, yrad, begang, endang); }
  255. void VDI::ellpie (int x, int y, int xrad, int yrad, int begang, int endang) { v_ellpie (handle, x, y, xrad, yrad, begang, endang); }
  256. void VDI::ellipse (int x, int y, int xrad, int yrad) { v_ellipse (handle, x, y, xrad, yrad); }
  257. void VDI::rbox (int pxyarray[]) { v_rbox (handle, pxyarray); }
  258. void VDI::rfbox (int pxyarray[]) { v_rfbox (handle, pxyarray); }
  259. void VDI::justified (int x, int y, char *str, int len, int word_space, int char_space) { v_justified (handle, x, y, str, len, word_space, char_space); }
  260.  
  261. int VDI::sin_mode  (int dev, int mode) { return vsin_mode  (handle, dev, mode); }
  262. void VDI::rq_locator (int x, int y, int *xout, int *yout, int *term) { vrq_locator (handle, x, y, xout, yout, term); }  
  263. int VDI::sm_locator (int x, int y, int *xout, int *yout, int *term) { return vsm_locator (handle, x, y, xout, yout, term); }
  264.  
  265. void VDI::rq_valuator (int in, int *out, int *term) { vrq_valuator (handle, in, out, term); }
  266. void VDI::sm_valuator (int in, int *out, int *term, int *status) { vsm_valuator (handle, in, out, term, status); }
  267. void VDI::rq_choice (int cin, int *cout) { vrq_choice (handle, cin, cout); }
  268. int VDI::sm_choice (int *choice) { return vsm_choice (handle, choice); }
  269. void VDI::rq_string (int len, int echo, int echoxy[], char *str) { vrq_string (handle, len, echo, echoxy, str); }
  270. int VDI::sm_string (int len, int echo, int echoxy[], char *str) { return vsm_string (handle, len, echo, echoxy, str); }
  271. void VDI::sc_form (int form[]) { vsc_form (handle, form); }
  272. void VDI::ex_timv (void *time_addr, void **otime_addr, int *time_conv) { vex_timv (handle, time_addr, otime_addr, time_conv); } 
  273. void VDI::show_c (int reset) { v_show_c (handle, reset); }
  274. void VDI::hide_c () { v_hide_c (handle); }
  275. void VDI::q_mouse (int *pstatus, int *x, int *y) { vq_mouse (handle, pstatus, x, y); }
  276. void VDI::ex_butv (void *new_p, void **old) { vex_butv (handle, new_p, old); }
  277. void VDI::ex_motv (void *new_p, void **old) { vex_motv (handle, new_p, old); }
  278. void VDI::ex_curv (void *new_p, void **old) { vex_curv (handle, new_p, old); }
  279. void VDI::q_key_s (int *state) { vq_key_s (handle, state); }
  280.  
  281. void VDI::q_extnd (int flag, int work_out[]) const { vq_extnd (handle, flag, work_out); }
  282. int VDI::q_color (int index, int flag, int rgb[]) const { return vq_color (handle, index, flag, rgb); }
  283. void VDI::ql_attribute (int atrib[]) const { vql_attribute (handle, atrib); }
  284. void VDI::qm_attributes (int atrib[]) const { vqm_attributes (handle, atrib); }
  285. void VDI::qf_attributes (int atrib[]) const { vqf_attributes (handle, atrib); }
  286. void VDI::qt_attributes (int atrib[]) const { vqt_attributes (handle, atrib); }
  287. void VDI::qt_extent (char *str, int extent[]) const { vqt_extent (handle, str, extent); }
  288. int VDI::qt_width (int chr, int *cw, int *ldelta, int *rdelta) const { return vqt_width (handle, chr, cw, ldelta, rdelta); }
  289. int VDI::qt_name (int element, char *name) const { return vqt_name (handle, element, name); }
  290. void VDI::q_cellarray (int pxyarray[], int row_len, int nrows, int *el_used, int *rows_used, int *status, int color[]) { vq_cellarray (handle, pxyarray, row_len, nrows, el_used, rows_used, status, color); }  
  291. void VDI::qin_mode (int dev, int *mode) { vqin_mode (handle, dev, mode); }
  292. void VDI::qt_fontinfo (int *minade, int *maxade, int distances[], int *maxwidth, int effects[]) { vqt_fontinfo (handle, minade, maxade, distances, maxwidth, effects); }  
  293. void VDI::qt_font_info (int *minade, int *maxade, int distances[], int *maxwidth, int effects[]) { vqt_font_info (handle, minade, maxade, distances, maxwidth, effects); }  
  294.  
  295. void VDI::pline (int count, int pxyarray[]) { v_pline (handle, count, pxyarray); }
  296. void VDI::pmarker (int count, int pxyarray[]) { v_pmarker (handle, count, pxyarray); }
  297. int VDI::gtext (int x, int y, char *str) { return v_gtext (handle, x, y, str); }
  298. void VDI::fillarea (int count, int pxyarray[]) { v_fillarea (handle, count, pxyarray); }
  299. void VDI::cellarray (int pxyarray[], int row_length, int elements, int nrows, int write_mode, int colarray[]) { v_cellarray (handle, pxyarray, row_length, elements, nrows, write_mode, colarray); }
  300. void VDI::contourfill (int x, int y, int index) { v_contourfill (handle, x, y, index); }
  301. void VDI::r_recfl (int pxyarray[]) { vr_recfl (handle, pxyarray); }
  302.  
  303. void VDI::ro_cpyfm (int mode, int pxyarray[], const MFDB& src, const MFDB& dst) { vro_cpyfm (handle, mode, pxyarray, (MFDB*)&src, (MFDB*)&dst); }
  304. void VDI::rt_cpyfm (int mode, int pxyarray[], const MFDB& src, const MFDB& dst, int color[]) { vrt_cpyfm (handle, mode, pxyarray, (MFDB*)&src, (MFDB*)&dst, color); }  
  305. void VDI::r_trnfm (const MFDB& src, const MFDB& dst) { vr_trnfm (handle, (MFDB*)&src, (MFDB*)&dst); }
  306. void VDI::get_pixel (int x, int y, int *pel, int *indx) { v_get_pixel (handle, x, y, pel, indx); } 
  307.  
  308. void VDI::q_chcells (int *n_rows, int *n_cols) { vq_chcells (handle, n_rows, n_cols); }
  309. void VDI::exit_cur () { v_exit_cur (handle); }
  310. void VDI::enter_cur () { v_enter_cur (handle); }
  311. void VDI::curup () { v_curup (handle); }
  312. void VDI::curdown () { v_curdown (handle); }
  313. void VDI::curright () { v_curright (handle); }
  314. void VDI::curleft () { v_curleft (handle); }
  315. void VDI::curhome () { v_curhome (handle); }
  316. void VDI::eeos () { v_eeos (handle); }
  317. void VDI::eeol () { v_eeol (handle); }
  318. void VDI::s_curaddress (int row, int col) { vs_curaddress (handle, row, col); }
  319. void VDI::curtext (char *s) { v_curtext (handle, s); }
  320. void VDI::rvon () { v_rvon (handle); }
  321. void VDI::rvoff () { v_rvoff (handle); }
  322. void VDI::q_curaddress (int *cur_row, int *cur_col) { vq_curaddress (handle, cur_row, cur_col); }
  323. int VDI::q_tabstatus () { return vq_tabstatus (handle); }
  324. void VDI::hardcopy () { v_hardcopy (handle); }
  325. void VDI::dspcur  (int x, int y) { v_dspcur  (handle, x, y); }
  326. void VDI::rmcur () { v_rmcur (handle); }
  327. void VDI::form_adv () { v_form_adv (handle); }
  328. void VDI::output_window (int *pxyarray) { v_output_window (handle, pxyarray); }
  329. void VDI::clear_disp_list () { v_clear_disp_list (handle); }
  330. void VDI::bit_image (const char *filename, int aspect, int x_scale, int y_scale, int h_align, int v_align, int *pxyarray) { v_bit_image (handle, filename, aspect, x_scale, y_scale, h_align, v_align, pxyarray); }
  331. void VDI::q_scan (int *g_slice, int *g_page, int *a_slice, int *a_page, int *div_fac) { vq_scan (handle, g_slice, g_page, a_slice, a_page, div_fac); }
  332. void VDI::alpha_text (const char *string) { v_alpha_text (handle, string); }
  333. int VDI::s_palette (int palette) { return vs_palette (handle, palette); }
  334. void VDI::sound (int frequency, int duration) { v_sound (handle, frequency, duration); }
  335. int VDI::s_mute (int action) { return vs_mute (handle, action); }
  336. void VDI::t_resolution (int xres, int yres, int *xset, int *yset) { vt_resolution (handle, xres, yres, xset, yset); }
  337. void VDI::t_axis (int xres, int yres, int *xset, int *yset) { vt_axis (handle, xres, yres, xset, yset); }
  338. void VDI::t_origin (int xorigin, int yorigin) { vt_origin (handle, xorigin, yorigin); }
  339. void VDI::q_dimensions (int *xdimension, int *ydimension) { vq_dimensions (handle, xdimension, ydimension); }
  340. void VDI::t_alignment (int dx, int dy) { vt_alignment (handle, dx, dy); }
  341. void VDI::sp_film (int index, int lightness) { vsp_film (handle, index, lightness); }
  342. int VDI::qp_filmname (int index, char *name) { return vqp_filmname (handle, index, name); }
  343. void VDI::sc_expose (int state) { vsc_expose (handle, state); }
  344. void VDI::meta_extents (int min_x, int min_y, int max_x, int max_y) { v_meta_extents (handle, min_x, min_y, max_x, max_y); }
  345. void VDI::write_meta (int num_intin, int *a_intin, int num_ptsin, int *a_ptsin) { v_write_meta (handle, num_intin, a_intin, num_ptsin, a_ptsin); }
  346. void VDI::m_pagesize (int pgwidth, int pgheight) { vm_pagesize (handle, pgwidth, pgheight); }
  347. void VDI::m_coords (int llx, int lly, int urx, int ury) { vm_coords (handle, llx, lly, urx, ury); }
  348. void VDI::m_filename (const char *filename) { vm_filename (handle, filename); }
  349. void VDI::escape2000 (int times) { v_escape2000 (handle, times); }
  350. unsigned long VDI::q_vgdos () { return vq_vgdos (); }
  351. void VDI::getbitmap_info (int ch, long *advancex, long *advancey, long *xoffset, long *yoffset, int *width, int *height, short **bitmap) { v_getbitmap_info (handle, ch,  advancex, advancey, xoffset, yoffset, width, height, bitmap); }
  352. void VDI::qt_f_extent (const char *str, int extent[]) { vqt_f_extent (handle, str, extent); }
  353. void VDI::ftext (int x, int y, const char *str) { v_ftext (handle, x, y, str); }
  354. //void VDI::killoutline (void *component) { v_killoutline (handle, component); }
  355. void VDI::getoutline (int ch, int *xyarray, char *bezarray, int maxverts, int *numverts) { v_getoutline (handle, ch, xyarray, bezarray, maxverts, numverts); }
  356. void VDI::st_scratch (int mode) { vst_scratch (handle, mode); }
  357. void VDI::st_error (int mode, short *errorvar) { vst_error (handle, mode, errorvar); }
  358. int VDI::st_arbpt (int point, int *wchar, int *hchar, int *wcell, int *hcell ) { return vst_arbpt (handle, point, wchar, hchar, wcell, hcell ); }
  359. void VDI::qt_advance (int ch, int *xadv, int *yadv, int *xrem, int *yrem) { vqt_advance (handle, ch, xadv, yadv, xrem, yrem); } 
  360. void VDI::qt_devinfo (int device, int *isdev, char *drivername ) { vqt_devinfo (handle, device, isdev, drivername ); }
  361. int VDI::savecache (char *filename ) { return v_savecache (handle, filename ); }
  362. int VDI::loadcache (char *filename, int mode ) { return v_loadcache (handle, filename, mode ); }
  363. int VDI::flushcache () { return v_flushcache (handle); }
  364. int VDI::st_setsize (int point, int *wchar, int *hchar, int *wcell, int *hcell ) { return vst_setsize (handle, point, wchar, hchar, wcell, hcell ); }
  365. int VDI::st_skew (int skew ) { return vst_skew (handle, skew ); }
  366. // void VDI::qt_get_tables (void **gascii, void **style ) { vqt_get_tables (handle, gascii, style ); }
  367. void VDI::qt_get_table (short **map) { vqt_get_table (handle, map ); }
  368. void VDI::qt_cachesize (int which_cache, size_t *size ) { vqt_cachesize (handle, which_cache, size ); }
  369. int VDI::bez (int count, int *xyarr, char *bezarr, int extent[4], int *npts, int *nmvs) { return v_bez (handle, count, xyarr, bezarr, extent, npts, nmvs); }
  370. int VDI::bez_fill (int count, int *xyarr, char *bezarr, int extent[4], int *npts, int *nmvs) { return v_bez_fill (handle, count, xyarr, bezarr, extent, npts, nmvs); }
  371. int VDI::bez_qual (int percent, int *actual) { return v_bez_qual (handle, percent, actual); }
  372. int VDI::bez_on () { return v_bez_on (handle); }
  373. void VDI::bez_off () { v_bez_off (handle); }
  374.  
  375. void VDI::shtext (int wsid, int x, int y, const char *text, int color, int xshadow, int yshadow ) { v_shtext (wsid, x, y, text, color, xshadow, yshadow ); }
  376. void VDI::set_app_buff (void **buf_p, int size) { v_set_app_buff (buf_p, size); }
  377.  
  378. // Shorthands...
  379. int  VDI::st_height(int height)
  380. {
  381.     int j;
  382.     return st_height(height,&j,&j,&j,&j);
  383. }
  384.  
  385. int     VDI::st_point(int point)
  386. {
  387.     int j;
  388.     return st_point(point,&j,&j,&j,&j);
  389. }
  390.  
  391. void VDI::st_alignment(int hin, int vin)
  392. {
  393.     st_alignment(hin,vin,&hin,&vin);
  394. }
  395.  
  396.  
  397. void VDI::clip()
  398. {
  399.     int j[]={0,0,MaxX(),MaxY()};
  400.     s_clip(1,j);
  401. }
  402.  
  403. void VDI::clip(int x1, int y1, int x2, int y2)
  404. {
  405.     int j[]={x1,y1,x2,y2};
  406.     s_clip(1,j);
  407. }
  408.  
  409. void VDI::clip_off()
  410. {
  411.     static int j[]={0,0,0,0};
  412.     s_clip(0,j);
  413. }
  414.  
  415.  
  416. void VDI::bar(int x1, int y1, int x2, int y2)
  417. {
  418.     int pxy[]={x1,y1,x2,y2};
  419.     bar(pxy);
  420. }
  421.  
  422. void VDI::rbox(int x1, int y1, int x2, int y2)
  423. {
  424.     int pxy[]={x1,y1,x2,y2};
  425.     rbox(pxy);
  426. }
  427.  
  428. void VDI::rfbox(int x1, int y1, int x2, int y2)
  429. {
  430.     int pxy[]={x1,y1,x2,y2};
  431.     rfbox(pxy);
  432. }
  433.  
  434. void VDI::line(int x1, int y1, int x2, int y2)
  435. {
  436.     int pxy[]={x1,y1,x2,y2};
  437.     pline(2,pxy);
  438. }
  439.  
  440. void VDI::marker(int x, int y)
  441. {
  442.     int pxy[]={x,y};
  443.     pmarker(1,pxy);
  444. }
  445.  
  446. void VDI::r_recfl(int x1, int y1, int x2, int y2)
  447. {
  448.     int pxy[]={x1,y1,x2,y2};
  449.     r_recfl(pxy);
  450. }
  451.  
  452.  
  453. void VDI::ro_cpyfm (int mode, int pxyarray[], VDI& from)
  454. {
  455.     ro_cpyfm(mode,pxyarray,from.MF(),MF());
  456. }
  457.  
  458. void VDI::rt_cpyfm (int mode, int pxyarray[], VDI& from, int color[])
  459. {
  460.     rt_cpyfm(mode,pxyarray,from.MF(),MF(),color);
  461. }
  462.   
  463. void VDI::r_trnfm (VDI& from)
  464. {
  465.     r_trnfm(from.MF(),MF());
  466. }
  467.  
  468. void VDI::ro_cpyfm(int mode, int pxyarray[])
  469. {
  470.     ro_cpyfm(mode,pxyarray,MF(),MF());
  471. }
  472.  
  473. void VDI::rt_cpyfm(int mode, int pxyarray[], int color[])
  474. {
  475.     rt_cpyfm(mode,pxyarray,MF(),MF(),color);
  476. }
  477.  
  478. void VDI::r_trnfm()
  479. {
  480.     r_trnfm(MF(),MF());
  481. }
  482.  
  483.  
  484. int VDI::CharWidth() const
  485. {
  486.     int settings[10];
  487.  
  488.     qt_attributes(settings);
  489.     
  490.     return settings[6];
  491. }
  492.  
  493. int VDI::CharHeight() const
  494. {
  495.     int settings[10];
  496.     
  497.     qt_attributes(settings);
  498.  
  499.     return settings[7];
  500. }
  501.  
  502. int VDI::CharCellWidth() const
  503. {
  504.     int settings[10];
  505.  
  506.     qt_attributes(settings);
  507.     
  508.     return settings[8];
  509. }
  510.  
  511. int VDI::CharCellHeight() const
  512. {
  513.     int settings[10];
  514.     
  515.     qt_attributes(settings);
  516.     
  517.     return settings[9];
  518. }
  519.  
  520. const MFDB& VDI::MF()
  521. {
  522.     return AESMFDB;
  523. }
  524.  
  525. int VDI::WorkOut(int index) const
  526. {
  527.     return WORKOUTfor(this,FALSE,TRUE)[index];
  528. }
  529.  
  530. int VDI::ExtWorkOut(int index) const
  531. {
  532.     return WORKOUTfor(this,TRUE,TRUE)[index];
  533. }
  534.